<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>员工工资查询</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .card {
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .btn-primary {
            transition: all 0.3s ease;
        }
        .btn-primary:hover {
            background-color: #0056b3;
        }
        table {
            border-radius: 10px;
            overflow: hidden;
        }
        th, td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div class="container mt-5">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="card p-4">
                    <h2 class="mb-4 text-center">员工工资查询</h2>
                    <form method="post">
                        <div class="mb-3">
                            <label for="name" class="form-label">输入姓名：</label>
                            <input type="text" id="name" name="name" class="form-control" required>
                        </div>
                        <button type="submit" class="btn btn-primary w-100">查询</button>
                    </form>
                </div>
            </div>
        </div>

        {% if employee_name %}
        <div class="mt-4">
            <div class="card p-4">
                <h3 class="text-center">{{ employee_name }} 的工资明细</h3>
                {% if wages %}
                <div class="table-responsive">
                    <table class="table table-striped table-hover mt-3">
                        <thead class="table-dark">
                            <tr>
                                <th>档口</th>
                                <th>菜品</th>
                                <th>计件工资</th>
                                <th>销量</th>
                                <th>计件工资金额</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for wage in wages %}
                            <tr>
                                <td>{{ wage.档口 }}</td>
                                <td>{{ wage.菜品 }}</td>
                                <td>{{ wage.计件工资 }}</td>
                                <td>{{ wage.销量 }}</td>
                                <td>{{ wage.计件工资金额 }}</td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
                <p class="mt-3 text-center"><strong>工资总额：</strong> {{ total_wage }} 元</p>
                {% else %}
                <p class="mt-3 text-danger text-center">未找到工资明细</p>
                {% endif %}
            </div>
        </div>
        {% endif %}
    </div>
</body>
</html>
